﻿<%@ Page Title="" Language="C#" MasterPageFile="~/myMaster.Master" AutoEventWireup="true" CodeBehind="Patience.aspx.cs" Inherits="ElectronicHealthRecord.Patience" %>
<asp:Content ID="Content1" runat="server" contentplaceholderid="MainContent">
    <p class="auto-style7" style="text-indent: 10px; height: 0px; font-size: large;">
                                        Patience List
        <br />
        <br />
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" DataKeyNames="amka" DataSourceID="SqlDataSource1" ShowFooter="True" OnRowCommand="GridView1_RowCommand">
            <AlternatingRowStyle BackColor="White" />
            <Columns>     
                <asp:TemplateField HeaderText="AMKA" SortExpression="amka">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("amka") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("amka") %>'></asp:Label>
                    </ItemTemplate>
                     
                </asp:TemplateField>
               
                <asp:TemplateField HeaderText="Όνομα" SortExpression="fName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("fName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("fName") %>'></asp:Label>
                    </ItemTemplate>
                    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Επίθετο" SortExpression="lName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("lName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("lName") %>'></asp:Label>
                    </ItemTemplate>
                   
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Όνομα Πατέρα" SortExpression="fatherName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("fatherName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("fatherName") %>'></asp:Label>
                    </ItemTemplate>
                    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Όνομα Μητέρας" SortExpression="motherName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("motherName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("motherName") %>'></asp:Label>
                    </ItemTemplate>
                   
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Τηλέφωνο 1" SortExpression="tel1">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("tel1") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("tel1") %>'></asp:Label>
                    </ItemTemplate>
                    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Τηλέφωνο 2" SortExpression="tel2">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("tel2") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("tel2") %>'></asp:Label>
                    </ItemTemplate>
                   
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Διεύθυνση" SortExpression="address">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("address") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("address") %>'></asp:Label>
                    </ItemTemplate>
                    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Νούμερο" SortExpression="num">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("num") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label9" runat="server" Text='<%# Bind("num") %>'></asp:Label>
                    </ItemTemplate>
                    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Περιοχή" SortExpression="area">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("area") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label10" runat="server" Text='<%# Bind("area") %>'></asp:Label>
                    </ItemTemplate>
                    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Πόλη" SortExpression="city">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("city") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label11" runat="server" Text='<%# Bind("city") %>'></asp:Label>
                    </ItemTemplate>
                   
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ΤΚ" SortExpression="postcode">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("postcode") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label12" runat="server" Text='<%# Bind("postcode") %>'></asp:Label>
                    </ItemTemplate>
                    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ηλικία" SortExpression="age">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("age") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label13" runat="server" Text='<%# Bind("age") %>'></asp:Label>
                    </ItemTemplate>
                    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Επάγγελμα" SortExpression="job">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("job") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label14" runat="server" Text='<%# Bind("job") %>'></asp:Label>
                    </ItemTemplate>                    
                </asp:TemplateField>

                 <asp:TemplateField HeaderText="Add Examination" SortExpression="addex">
                    
                    <ItemTemplate>
                       <asp:LinkButton ID="addExamination" CommandName="AddExamination" CommandArgument='<%# Bind("amka") %>'  runat="server">Add Examination</asp:LinkButton>
                    </ItemTemplate>
                    
                </asp:TemplateField>

                <asp:TemplateField HeaderText="History" SortExpression="history">
                    
                    <ItemTemplate>
                       <asp:LinkButton ID="patienceHistory" CommandName="examinationsHistory" CommandArgument='<%# Bind("amka") %>'  runat="server">History</asp:LinkButton>
                    </ItemTemplate>
                    
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
                                        </asp:GridView>
                                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="server=localhost;user id=root;database=ehrdb" DeleteCommand="DELETE FROM patience WHERE amka = ?" InsertCommand="INSERT INTO patience (amka, fName, lName, fatherName, motherName, tel1, tel2, address, num, area, city, postcode, age, job) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ProviderName="MySql.Data.MySqlClient" SelectCommand="SELECT * FROM patience" UpdateCommand="UPDATE patience SET fName = ?, lName = ?, fatherName = ?, motherName = ?, tel1 = ?, tel2 = ?, address = ?, num = ?, area = ?, city = ?, postcode = ?, age = ?, job = ? WHERE amka = ?">
                                            <DeleteParameters>
                                                <asp:Parameter Name="amka" Type="Int32" />
                                            </DeleteParameters>
                                            <InsertParameters>
                                                <asp:Parameter Name="amka" Type="Int32" />
                                                <asp:Parameter Name="fName" Type="String" />
                                                <asp:Parameter Name="lName" Type="String" />
                                                <asp:Parameter Name="fatherName" Type="String" />
                                                <asp:Parameter Name="motherName" Type="String" />
                                                <asp:Parameter Name="tel1" Type="Int32" />
                                                <asp:Parameter Name="tel2" Type="Int32" />
                                                <asp:Parameter Name="address" Type="String" />
                                                <asp:Parameter Name="num" Type="Int32" />
                                                <asp:Parameter Name="area" Type="String" />
                                                <asp:Parameter Name="city" Type="String" />
                                                <asp:Parameter Name="postcode" Type="String" />
                                                <asp:Parameter Name="age" Type="String" />
                                                <asp:Parameter Name="job" Type="String" />
                                            </InsertParameters>
                                            <UpdateParameters>
                                                <asp:Parameter Name="fName" Type="String" />
                                                <asp:Parameter Name="lName" Type="String" />
                                                <asp:Parameter Name="fatherName" Type="String" />
                                                <asp:Parameter Name="motherName" Type="String" />
                                                <asp:Parameter Name="tel1" Type="Int32" />
                                                <asp:Parameter Name="tel2" Type="Int32" />
                                                <asp:Parameter Name="address" Type="String" />
                                                <asp:Parameter Name="num" Type="Int32" />
                                                <asp:Parameter Name="area" Type="String" />
                                                <asp:Parameter Name="city" Type="String" />
                                                <asp:Parameter Name="postcode" Type="String" />
                                                <asp:Parameter Name="age" Type="String" />
                                                <asp:Parameter Name="job" Type="String" />
                                                <asp:Parameter Name="amka" Type="Int32" />
                                            </UpdateParameters>
                                        </asp:SqlDataSource>
        <br />
        <br />
                                        <asp:Button ID="addPatience" runat="server" OnClick="addPatience_Click" style="margin-left: 29px" Text="Add Patience" />
            &nbsp;&nbsp;
        <asp:Button ID="Statistics" runat="server" Text="Statistics" OnClick="Statistics_Click" />
    </p>

                                </asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">
    <style type="text/css">
    .auto-style7 {}
</style>
</asp:Content>

